#include "libbmp/bmpfile.c"
#include "libjpg/jpeg.c"
#define TRIM_SUFFIX "_t"

/* Structures and type definitions */
struct _image {
    /* new image arguments */
    string      path;
    string      filename;
    string      extension;
    /* image data pointers */
    bmpfile_t*  bitmap;
    jpegfile_t* jpeg;
    /* image dimensions (image data dipendent) */
    int         width;
    int         height;
    /* file-specific properties */
    FILE*       fp;
    string      md5sum;
    int         filesize;
};
typedef struct _image* image;

/* Function declarations */
image open_image(string);
image bmp_trim(image, int);
image clone(image, string);
image new_image(string, string, string);
bool save_image(image);
void close_image(image);
int get_file_data(image, string);
FILE* get_file_pointer(image, string);
void set_dimensions(image);
string get_fullpath(image);
int is_bitmap(image);
int is_jpeg(image);
int has_extension(image, string*);
float rgb2mono(rgb_pixel_t);
void details(image);
